<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ include file="../head.jsp"%>
<body>
<%@ include file="../navbar.jsp"%><!--导航 -->
<div class="container widget">
	<div class="toolbar text-right">
		<a href="${ctx}/typical/addTypical" class="btn btn-default btn-sm" role="button">新增</a>&nbsp;
		<a href="#" class="btn btn-default btn-sm" role="button"><i class="icon-refresh"></i>刷新</a>
	</div>
	<div class="">
		<table class="table table-bordered table-striped">
		   <thead>
		      <tr>
		         <th>序号</th>
		         <!-- <th>编号</th> -->
		         <th>名称</th>
		         <th>副名称</th>
		         <th>标题</th>
		         <th>排序号</th>
		         <th>创建时间</th>
		         <th>更新时间</th>
		         <th>操作</th>
		      </tr>
		   </thead>
			<tbody>
			<c:forEach var="listInfo" items="${typicalCasesList}" varStatus="status">
		      	<tr>
		         	<td width="5%">${status.index + 1}</td>
		         	<%-- <td>${listInfo.id}</td> --%>
		         	<td width="10%">${listInfo.typicalName}</td>
		         	<td width="13%">${listInfo.typicalSubName}</td>
		         	<td width="20%">${listInfo.typicalTitle}</td>
		         	<td width="8%">${listInfo.sort}</td>
		         	<td width="16%">${fn:substring(listInfo.createTime,0,19)}</td>
		         	<td width="16%">${fn:substring(listInfo.updateTime,0,19)}</td>
		         	<td width="12%">
		         	<a href="${ctx}/typical/updTypical.do?id=${listInfo.id}">修改</a>
		         	&nbsp;<a href="${ctx}/typical/delTypicalById.do?id=${listInfo.id}" onclick="javascript:if(!confirm('确定删除吗?')) return false;">删除</a>
		         	</td>
		      	</tr>
			</c:forEach>
			</tbody>
		</table>
	</div>
</div>
<script type="text/javascript">
	document.title = "德燊后台-案例管理";
	$(function(){
		var rstCode = '${param.resultCode}';
		if(rstCode != ""){
			if(rstCode == 1){
				alert("删除成功");
			}else if(rstCode == 0){
				alert("删除失败");
			}else{
				alert("参数异常");
			}
		}
		$(".toolbar a:last").on("click",function(){
			ajaxRequestTB("${ctx}/index/refreshTypical",
				{},function(data) {
					alert(data.retMsg);
					if (data.retCode == -1) {
						location.href = "${ctx}/sys/login";
					}
				});
		});
	});
</script>
</body>

